<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="format-detection" content="telephone=no,email=no,adress=no">
<link href="<%=request.getContextPath()%>/css/global.css" type="text/css" rel="stylesheet" />
<link href="<%=request.getContextPath() %>/js/easyui/themes/metro/easyui.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath() %>/js/date/skin/WdatePicker.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath()%>/js/autocomplate/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/global.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/easyui/easyui.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/date/WdatePicker.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/autocomplate/jquery.autocomplete.js"></script>
<script type="text/javascript">

$(function(){

	transactionCondition();
	cardCondition();
	
	$('#merNo').autocomplete({
    	serviceUrl: '<%=request.getContextPath()%>/merchant_auto.html',
    	minChars:1,
    	paramName:'merNo',
    	transformResult: function(response) {
		　　return {
		　　　　suggestions: $.map($.parseJSON(response), function(dataItem) {
		　　　　　　return { value: dataItem.merNo, data: dataItem.merName};
		　　　　})
		　　};
		},
    	formatResult:function (suggestion, currentValue) {
    		return "[" + suggestion.value.replace(currentValue,"<strong>"+currentValue+"</strong>")+ "]" + suggestion.data;
    	}
	});

	$("#dataTable").datagrid({
		toolbar: '#dataSearch',
		fitColumns:true,
		striped: true, 
		singleSelect:false,
		pagination:true,
		rownumbers:true,
		SelectOnCheck:true,
		CheckOnSelect:true,
        onSelect: function(index,row){
        	var nos="";
        	var rows = $('#dataTable').datagrid('getSelections');
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onUnselect: function(index,row){
        	var nos="";
        	var rows = $('#dataTable').datagrid('getSelections');
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onSelectAll: function(rows){
        	var nos="";
        	for(var i=0; i<rows.length; i++){
        		nos=nos+rows[i].ck+",";
        	}
			$("#keys").val(nos);
    	},
    	onUnselectAll: function(rows){
			$("#keys").val("");
    	}
	});
	
	$('#dataTable').datagrid('getPager').pagination({
		total:<s:property value="pageInfo.pageRecord"/>,
		pageNumber:<s:property value="pageInfo.pageIndex"/>,
		pageSize:<s:property value="pageInfo.pageSize"/>,
		pageList: [20,50,100] ,
		onSelectPage:function(pageNumber,pageSize){  
			toPage(pageNumber,pageSize);
		},
		onRefresh:function(pageNumber,pageSize){  
			location.reload();
		}
	});
	
});
function transactionCondition(){
	if($("#high").prop("checked")){
		$(".ac").show();
	}else{
		$(".ac").hide();
	}
}

function cardCondition(){
	if($("#crdJoin").prop("checked")){
		$(".bc").show();
	}else{
		$(".bc").hide();
	}
}
</script>
</head>
<body >
<div id="dataSearch" >    
<form id="sform" action="transaction_view.html" method="get" enctype="multipart/form-data">
<table style="width: 100%;">
<tr>
<td height="25" >
	<b>操作说明:交易流水号由商户号加子账户号加网站序列号组成</b> 
</td>
</tr>
<tr><td height="30" >
<s:textfield  id="txnNo" name="txnNo" placeholder="流水号"></s:textfield>
<s:textfield  id="merNo" name="merNo" placeholder="商户编号"></s:textfield>
<s:textfield  id="txnOrder" name="txnOrder" placeholder="商户订单号"></s:textfield>
<s:textfield  id="txnSite" name="txnSite" placeholder="来源网站"></s:textfield>
<s:textfield  id="txnDateTop"  name="txnDateTop" placeholder="发生日期起"  onclick="WdatePicker();"  cssStyle="width:100px;" ><s:param name="value"><s:date name="txnDateTop" format="yyyy-MM-dd"/></s:param></s:textfield>
 - 
<s:textfield  id="txnDateEnd"  name="txnDateEnd" placeholder="发生日期止"  onclick="WdatePicker();"  cssStyle="width:100px;" ><s:param name="value"><s:date name="txnDateEnd" format="yyyy-MM-dd"/></s:param></s:textfield>


加入持卡人信息<s:checkbox id="crdJoin" name="crdJoin" onclick="cardCondition();" ></s:checkbox>
交易金额汇总<s:checkbox id="txnSummary" name="txnSummary"  ></s:checkbox>
<input type="button" class="submit" value="提交查询" onclick="sform.submit();"/>
<input type="button" class="submit" value="高级搜索" onclick="$('#high').click();"/>
<s:checkbox id="high" name="high"  onclick="transactionCondition();" cssStyle="display:none;"></s:checkbox>
</td>
</tr>
<tr><td><hr/></td></tr>
<tr class="ac" style="display: none;"><td height="30" >
<s:select id="txnRefund" name="txnRefund" list="#{'1':'有效','0':'无效'}" headerKey="" headerValue="退款状态"/>
<s:select id="txnRefuse" name="txnRefuse" list="#{'1':'有效','0':'无效'}" headerKey="" headerValue="拒付状态"/>
<s:select id="txnFreeze" name="txnFreeze" list="#{'1':'有效','0':'无效'}" headerKey="" headerValue="冻结状态"/>
<s:select id="txnLogic" name="txnLogic" list="#{'1':'有效','0':'无效'}" headerKey="" headerValue="发货状态"/>
<s:select id="txnSettle" name="txnSettle" list="#{'1':'有效','0':'无效'}" headerKey="" headerValue="结算状态"/>
<s:select id="txnDanger" name="txnDanger" list="#{'1':'有效','0':'无效'}" headerKey="" headerValue="安全状态"/>
<s:select id="txnVisible" name="txnVisible" list="#{'1':'有效','0':'无效'}" headerKey="" headerValue="隐藏状态"/>
<s:select id="txnState" name="txnState" list="#{'1':'有效','0':'无效'}" headerKey="" headerValue="交易状态"/>
<s:textfield  id="txnCur" name="txnCur" placeholder="原交易币种"></s:textfield>
<s:textfield id="txnLoc" name="txnLoc" placeholder="原交易金额"></s:textfield>
<s:textfield id="txnAmount" name="txnAmount" placeholder="交易金额"></s:textfield>
<s:textfield  id="txnProduct" name="txnProduct" placeholder="产品信息"></s:textfield>
</td>
</tr>
<tr class="ac" style="display: none;"><td><hr/></td></tr>
<tr class="bc" style="display: none;"><td height="30" >
<s:textfield  id="crdNo" name="crdNo" placeholder="卡编号" cssStyle="width:240px;" ></s:textfield>
<s:select id="crdType" name="crdType" list="@dicts.CardDict@CARD_LIST" headerKey="" headerValue="卡类型"/>
<s:textfield  id="crdNumber" name="crdNumber" placeholder="卡号" cssStyle="width:240px;" ></s:textfield>
<s:textfield  id="crdIp" name="crdIp" placeholder="ip地址" cssStyle="width:240px;" ></s:textfield>
<s:textfield  id="crdCode" name="crdCode" placeholder="ip国家码" cssStyle="width:100px;" ></s:textfield>
<s:textfield  id="crdBin" name="crdBin" placeholder="bin国家码" cssStyle="width:100px;" ></s:textfield>
</td>
</tr>
<tr class="bc"  style="display: none;"><td height="30" >
<s:textfield  id="crdCfname" name="crdCfname" placeholder="收货人姓" cssStyle="width:100px;" ></s:textfield>-<s:textfield  id="crdClname" name="crdClname" placeholder="收货人名" cssStyle="width:100px;" ></s:textfield>
<s:textfield  id="crdCphone" name="crdCphone" placeholder="电话" cssStyle="width:160px;" ></s:textfield>
<s:textfield  id="crdCemail" name="crdCemail" placeholder="邮箱" cssStyle="width:240px;"></s:textfield>
<s:textfield  id="crdCcountry" name="crdCcountry" placeholder="国家" cssStyle="width:100px;" ></s:textfield>
<s:textfield  id="crdCstate" name="crdCstate" placeholder="州/省" cssStyle="width:100px;" ></s:textfield>
<s:textfield  id="crdCcity" name="crdCcity" placeholder="城市" cssStyle="width:100px;" ></s:textfield>
<s:textfield  id="crdCaddr" name="crdCaddr" placeholder="地址" cssStyle="width:240px;"></s:textfield>
<s:textfield  id="crdCzip" name="crdCzip" placeholder="邮编" cssStyle="width:100px;" ></s:textfield>
</td>
</tr>
<tr class="bc" style="display: none;"><td height="30" >
<s:textfield  id="crdHfname" name="crdHfname" placeholder="持卡人姓" cssStyle="width:100px;" ></s:textfield>-<s:textfield  id="crdHlname" name="crdHlname" placeholder="持卡人名" cssStyle="width:100px;" ></s:textfield>
<s:textfield  id="crdHphone" name="crdHphone" placeholder="电话" cssStyle="width:160px;" ></s:textfield>
<s:textfield  id="crdHemail" name="crdHemail" placeholder="邮箱" cssStyle="width:240px;"></s:textfield>
<s:textfield  id="crdHcountry" name="crdHcountry" placeholder="国家" cssStyle="width:100px;" ></s:textfield>
<s:textfield  id="crdHstate" name="crdHstate" placeholder="州/省" cssStyle="width:100px;" ></s:textfield>
<s:textfield  id="crdHcity" name="crdHcity" placeholder="城市" cssStyle="width:100px;" ></s:textfield>
<s:textfield  id="crdHaddr" name="crdHaddr" placeholder="地址" cssStyle="width:240px;"></s:textfield>
<s:textfield  id="crdHzip" name="crdHzip" placeholder="邮编" cssStyle="width:100px;" ></s:textfield>
</td>
</tr>
<tr class="bc"  style="display: none;"><td><hr/></td></tr>
<tr>
<td >
	<input type="hidden"  id="keys" name="keys"  value=""/>
	<input type="button" class="submit"   value="导出数据"  onclick="if(confirm('确认要执行导出操作吗?')){window.open(location.href.replace('view','educe'));}"/>
	&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="button" class="submit" value="编号排序" onclick="toSort('sortField','txnNo')"/>
	<input type="button" class="submit" value="日期排序" onclick="toSort('sortField','txnDate')"/>	
	
	&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="button" class="submit" value="升序排列" onclick="toSort('sortOrder','true')"/>
	<input type="button" class="submit" value="降序排列" onclick="toSort('sortOrder','false')"/>
	
	<s:if test="txnAmountTotal!=null"><label style="float: right;margin-right: 20px;">交易金额汇总 : <s:text name="global.format.number"><s:param value="txnAmountTotal"/></s:text> CNY</label></s:if>
</td>
</tr>
</table>
</form>
</div>

<table id="dataTable" style="width: 100%;" class="easyui-datagrid" >
<thead>
<tr>
<th data-options="field:'ck'" checkbox="true"></th>
<th data-options="field:'txnNo', width:'12%',align:'left' , halign: 'left'">编号</th>
<th data-options="field:'merNo', width:'4%',align:'left' , halign: 'left'">商编</th>
<th data-options="field:'txnOrder', width:'12%',align:'left' , halign: 'left'">商户订单号</th>
<th data-options="field:'txnSite', width:'12%',align:'left' , halign: 'left'">来源网站</th>
<th data-options="field:'crdIp', width:'10%',align:'left' , halign: 'left'">卡IP</th>
<th data-options="field:'crdFake', width:'12%',align:'left' , halign: 'left'">卡号</th>
<th data-options="field:'crdCemail', width:'12%',align:'left' , halign: 'left'">收货人邮箱</th>
<th data-options="field:'txnRefund', width:'2%',align:'left' , halign: 'left'">退</th>
<th data-options="field:'txnRefuse', width:'2%',align:'left' , halign: 'left'">拒</th>
<th data-options="field:'txnFreeze', width:'2%',align:'left' , halign: 'left'">冻</th>
<th data-options="field:'txnLogic', width:'2%',align:'left' , halign: 'left'">发</th>
<th data-options="field:'txnSettle', width:'2%',align:'left' , halign: 'left'">结</th>
<th data-options="field:'txnDanger', width:'2%',align:'left' , halign: 'left'">危</th>
<th data-options="field:'txnState', width:'2%',align:'left' , halign: 'left'">付</th>
<th data-options="field:'txnDate', width:'10%',align:'left' , halign: 'left'">发生日期</th>

</tr>
</thead>
<tbody>
<s:iterator value="transactionCardList" id="show" status="seq">
<tr>
<td><s:property value="#show.txnNo"/></td>
<td><a href="<%=request.getContextPath()%>/transaction_show.html?txnNo=<s:property value="#show.txnNo"/>"><s:property value="#show.txnNo"/></a></td>
<td><a href="<%=request.getContextPath()%>/merchant_show.html?merNo=<s:property value="#show.merNo"/>"><s:property value="#show.merNo"/></a></td>
<td><s:property value="#show.txnOrder"/></td>
<td><a href="<%=request.getContextPath()%>/website_list.html?webAddress=<s:property value="#show.txnSite"/>"><s:property value="#show.txnSite"/></a></td>
<td><s:property value="#show.crdIp"/></td>
<td><s:property value="#show.crdFake"/></td>
<td><a href="<%=request.getContextPath()%>/card_list.html?crdCemail=<s:property value="#show.crdCemail"/>"><s:property value="#show.crdCemail"/></a></td>
<td><s:if test="#show.txnRefund==0"><img src="<%=request.getContextPath() %>/image/cancel.png"  /></s:if><s:else><img src="<%=request.getContextPath() %>/image/accept.png"  /></s:else></td>
<td><s:if test="#show.txnRefuse==0"><img src="<%=request.getContextPath() %>/image/cancel.png"  /></s:if><s:else><img src="<%=request.getContextPath() %>/image/accept.png"  /></s:else></td>
<td><s:if test="#show.txnFreeze==0"><img src="<%=request.getContextPath() %>/image/cancel.png"  /></s:if><s:else><img src="<%=request.getContextPath() %>/image/accept.png"  /></s:else></td>
<td><s:if test="#show.txnLogic==0"><img src="<%=request.getContextPath() %>/image/cancel.png"  /></s:if><s:else><img src="<%=request.getContextPath() %>/image/accept.png"  /></s:else></td>
<td><s:if test="#show.txnSettle==0"><img src="<%=request.getContextPath() %>/image/cancel.png"  /></s:if><s:else><img src="<%=request.getContextPath() %>/image/accept.png"  /></s:else></td>
<td><s:if test="#show.txnDanger==0"><img src="<%=request.getContextPath() %>/image/cancel.png"  /></s:if><s:else><img src="<%=request.getContextPath() %>/image/accept.png"  /></s:else></td>
<td><s:if test="#show.txnState==0"><img src="<%=request.getContextPath() %>/image/cancel.png"  /></s:if><s:else><img src="<%=request.getContextPath() %>/image/accept.png"  /></s:else></td>
<td><s:text name="global.format.dateminute"><s:param value="#show.txnDate"/></s:text>

</tr>
</s:iterator>
</tbody>
</table>
<br/>
<br/>
<br/>
</body>
</html>
